<!DOCTYPE HTML>

<html lang="en">
<head>

<title>JdbcDaoImpl (spring-security-docs 5.6.3 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="JdbcDaoImpl (spring-security-docs 5.6.3 API)";
        }
    }
    catch(err) {
    }
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">

<div class="topNav"><a id="navbar.top">

</a>
<div class="skipNav"><a href="JdbcDaoImpl.html#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">

</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="JdbcDaoImpl.html#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">

</a></div>

</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>

<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.springframework.security.core.userdetails.jdbc</a></div>
<h2 title="Class JdbcDaoImpl" class="title">Class JdbcDaoImpl</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.springframework.dao.support.DaoSupport</li>
<li>
<ul class="inheritance">
<li>org.springframework.jdbc.core.support.JdbcDaoSupport</li>
<li>
<ul class="inheritance">
<li>org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code>org.springframework.beans.factory.Aware</code>, <code>org.springframework.beans.factory.InitializingBean</code>, <code>org.springframework.context.MessageSourceAware</code>, <code><a href="../UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a></code></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="../../../provisioning/JdbcUserDetailsManager.html" title="class in org.springframework.security.provisioning">JdbcUserDetailsManager</a></code></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">JdbcDaoImpl</span>
extends org.springframework.jdbc.core.support.JdbcDaoSupport
implements <a href="../UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a>, org.springframework.context.MessageSourceAware</pre>
<div class="block"><tt>UserDetailsService</tt> implementation which retrieves the user details (username,
password, enabled flag, and authorities) from a database using JDBC queries.
<h3>Default Schema</h3> A default database schema is assumed, with two tables "users"
and "authorities".
<h4>The Users table</h4>
This table contains the login name, password and enabled status of the user.
<table summary="The Users Table">
<tr>
<th>Column</th>
</tr>
<tr>
<td>username</td>
</tr>
<tr>
<td>password</td>
</tr>
<tr>
<td>enabled</td>
</tr>
</table>
<h4>The Authorities Table</h4>
<table summary="The Authorities Table">
<tr>
<th>Column</th>
</tr>
<tr>
<td>username</td>
</tr>
<tr>
<td>authority</td>
</tr>
</table>
If you are using an existing schema you will have to set the queries
<tt>usersByUsernameQuery</tt> and <tt>authoritiesByUsernameQuery</tt> to match your
database setup (see <a href="JdbcDaoImpl.html#DEF_USERS_BY_USERNAME_QUERY"><code>DEF_USERS_BY_USERNAME_QUERY</code></a> and
<a href="JdbcDaoImpl.html#DEF_AUTHORITIES_BY_USERNAME_QUERY"><code>DEF_AUTHORITIES_BY_USERNAME_QUERY</code></a>).
<p>
In order to minimise backward compatibility issues, this implementation doesn't
recognise the expiration of user accounts or the expiration of user credentials.
However, it does recognise and honour the user enabled/disabled column. This should map
to a <tt>boolean</tt> type in the result set (the SQL type will depend on the database
you are using). All the other columns map to <tt>String</tt>s.
<h3>Group Support</h3> Support for group-based authorities can be enabled by setting
the <tt>enableGroups</tt> property to <tt>true</tt> (you may also then wish to set
<tt>enableAuthorities</tt> to <tt>false</tt> to disable loading of authorities
directly). With this approach, authorities are allocated to groups and a user's
authorities are determined based on the groups they are a member of. The net result is
the same (a UserDetails containing a set of <tt>GrantedAuthority</tt>s is loaded), but
the different persistence strategy may be more suitable for the administration of some
applications.
<p>
When groups are being used, the tables "groups", "group_members" and
"group_authorities" are used. See <a href="JdbcDaoImpl.html#DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY"><code>DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY</code></a> for
the default query which is used to load the group authorities. Again you can customize
this by setting the <tt>groupAuthoritiesByUsernameQuery</tt> property, but the format
of the rows returned should match the default.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">

</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#DEF_AUTHORITIES_BY_USERNAME_QUERY">DEF_AUTHORITIES_BY_USERNAME_QUERY</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY">DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#DEF_USERS_BY_USERNAME_QUERY">DEF_USERS_BY_USERNAME_QUERY</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected org.springframework.context.support.MessageSourceAccessor</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#messages">messages</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="fields.inherited.from.class.org.springframework.dao.support.DaoSupport">

</a>
<h3>Fields inherited from class&nbsp;org.springframework.dao.support.DaoSupport</h3>
<code>logger</code></li>
</ul>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">

</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#%3Cinit%3E()">JdbcDaoImpl</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">

</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#addCustomAuthorities(java.lang.String,java.util.List)">addCustomAuthorities</a></span>&#8203;(java.lang.String&nbsp;username,
java.util.List&lt;<a href="../../GrantedAuthority.html" title="interface in org.springframework.security.core">GrantedAuthority</a>&gt;&nbsp;authorities)</code></th>
<td class="colLast">
<div class="block">Allows subclasses to add their own granted authorities to the list to be returned
in the <tt>UserDetails</tt>.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>protected <a href="../UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#createUserDetails(java.lang.String,org.springframework.security.core.userdetails.UserDetails,java.util.List)">createUserDetails</a></span>&#8203;(java.lang.String&nbsp;username,
<a href="../UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;userFromUserQuery,
java.util.List&lt;<a href="../../GrantedAuthority.html" title="interface in org.springframework.security.core">GrantedAuthority</a>&gt;&nbsp;combinedAuthorities)</code></th>
<td class="colLast">
<div class="block">Can be overridden to customize the creation of the final UserDetailsObject which is
returned by the <tt>loadUserByUsername</tt> method.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>protected java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#getAuthoritiesByUsernameQuery()">getAuthoritiesByUsernameQuery</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#getEnableAuthorities()">getEnableAuthorities</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#getEnableGroups()">getEnableGroups</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>protected org.springframework.context.support.MessageSourceAccessor</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#getMessages()">getMessages</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>protected java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#getRolePrefix()">getRolePrefix</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#getUsersByUsernameQuery()">getUsersByUsernameQuery</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>protected void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#initDao()">initDao</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#isUsernameBasedPrimaryKey()">isUsernameBasedPrimaryKey</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>protected java.util.List&lt;<a href="../../GrantedAuthority.html" title="interface in org.springframework.security.core">GrantedAuthority</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#loadGroupAuthorities(java.lang.String)">loadGroupAuthorities</a></span>&#8203;(java.lang.String&nbsp;username)</code></th>
<td class="colLast">
<div class="block">Loads authorities by executing the SQL from
<tt>groupAuthoritiesByUsernameQuery</tt>.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>protected java.util.List&lt;<a href="../../GrantedAuthority.html" title="interface in org.springframework.security.core">GrantedAuthority</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#loadUserAuthorities(java.lang.String)">loadUserAuthorities</a></span>&#8203;(java.lang.String&nbsp;username)</code></th>
<td class="colLast">
<div class="block">Loads authorities by executing the SQL from <tt>authoritiesByUsernameQuery</tt>.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="../UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#loadUserByUsername(java.lang.String)">loadUserByUsername</a></span>&#8203;(java.lang.String&nbsp;username)</code></th>
<td class="colLast">
<div class="block">Locates the user based on the username.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>protected java.util.List&lt;<a href="../UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#loadUsersByUsername(java.lang.String)">loadUsersByUsername</a></span>&#8203;(java.lang.String&nbsp;username)</code></th>
<td class="colLast">
<div class="block">Executes the SQL <tt>usersByUsernameQuery</tt> and returns a list of UserDetails
objects.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#setAuthoritiesByUsernameQuery(java.lang.String)">setAuthoritiesByUsernameQuery</a></span>&#8203;(java.lang.String&nbsp;queryString)</code></th>
<td class="colLast">
<div class="block">Allows the default query string used to retrieve authorities based on username to
be overridden, if default table or column names need to be changed.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#setEnableAuthorities(boolean)">setEnableAuthorities</a></span>&#8203;(boolean&nbsp;enableAuthorities)</code></th>
<td class="colLast">
<div class="block">Enables loading of authorities (roles) from the authorities table.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#setEnableGroups(boolean)">setEnableGroups</a></span>&#8203;(boolean&nbsp;enableGroups)</code></th>
<td class="colLast">
<div class="block">Enables support for group authorities.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#setGroupAuthoritiesByUsernameQuery(java.lang.String)">setGroupAuthoritiesByUsernameQuery</a></span>&#8203;(java.lang.String&nbsp;queryString)</code></th>
<td class="colLast">
<div class="block">Allows the default query string used to retrieve group authorities based on
username to be overridden, if default table or column names need to be changed.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#setMessageSource(org.springframework.context.MessageSource)">setMessageSource</a></span>&#8203;(org.springframework.context.MessageSource&nbsp;messageSource)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#setRolePrefix(java.lang.String)">setRolePrefix</a></span>&#8203;(java.lang.String&nbsp;rolePrefix)</code></th>
<td class="colLast">
<div class="block">Allows a default role prefix to be specified.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#setUsernameBasedPrimaryKey(boolean)">setUsernameBasedPrimaryKey</a></span>&#8203;(boolean&nbsp;usernameBasedPrimaryKey)</code></th>
<td class="colLast">
<div class="block">If <code>true</code> (the default), indicates the
<a href="JdbcDaoImpl.html#getUsersByUsernameQuery()"><code>getUsersByUsernameQuery()</code></a> returns a username in response to a query.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JdbcDaoImpl.html#setUsersByUsernameQuery(java.lang.String)">setUsersByUsernameQuery</a></span>&#8203;(java.lang.String&nbsp;usersByUsernameQueryString)</code></th>
<td class="colLast">
<div class="block">Allows the default query string used to retrieve users based on username to be
overridden, if default table or column names need to be changed.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.springframework.jdbc.core.support.JdbcDaoSupport">

</a>
<h3>Methods inherited from class&nbsp;org.springframework.jdbc.core.support.JdbcDaoSupport</h3>
<code>checkDaoConfig, createJdbcTemplate, getConnection, getDataSource, getExceptionTranslator, getJdbcTemplate, initTemplateConfig, releaseConnection, setDataSource, setJdbcTemplate</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.springframework.dao.support.DaoSupport">

</a>
<h3>Methods inherited from class&nbsp;org.springframework.dao.support.DaoSupport</h3>
<code>afterPropertiesSet</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">

</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">

</a>
<h3>Field Detail</h3>
<a id="DEF_USERS_BY_USERNAME_QUERY">

</a>
<ul class="blockList">
<li class="blockList">
<h4>DEF_USERS_BY_USERNAME_QUERY</h4>
<pre>public static final&nbsp;java.lang.String DEF_USERS_BY_USERNAME_QUERY</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl.DEF_USERS_BY_USERNAME_QUERY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="DEF_AUTHORITIES_BY_USERNAME_QUERY">

</a>
<ul class="blockList">
<li class="blockList">
<h4>DEF_AUTHORITIES_BY_USERNAME_QUERY</h4>
<pre>public static final&nbsp;java.lang.String DEF_AUTHORITIES_BY_USERNAME_QUERY</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl.DEF_AUTHORITIES_BY_USERNAME_QUERY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY">

</a>
<ul class="blockList">
<li class="blockList">
<h4>DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY</h4>
<pre>public static final&nbsp;java.lang.String DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl.DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="messages">

</a>
<ul class="blockListLast">
<li class="blockList">
<h4>messages</h4>
<pre>protected&nbsp;org.springframework.context.support.MessageSourceAccessor messages</pre>
</li>
</ul>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">

</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">

</a>
<ul class="blockListLast">
<li class="blockList">
<h4>JdbcDaoImpl</h4>
<pre>public&nbsp;JdbcDaoImpl()</pre>
</li>
</ul>
</li>
</ul>
</section>

<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">

</a>
<h3>Method Detail</h3>
<a id="getMessages()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getMessages</h4>
<pre class="methodSignature">protected&nbsp;org.springframework.context.support.MessageSourceAccessor&nbsp;getMessages()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the messages</dd>
</dl>
</li>
</ul>
<a id="addCustomAuthorities(java.lang.String,java.util.List)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>addCustomAuthorities</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;addCustomAuthorities&#8203;(java.lang.String&nbsp;username,
                                    java.util.List&lt;<a href="../../GrantedAuthority.html" title="interface in org.springframework.security.core">GrantedAuthority</a>&gt;&nbsp;authorities)</pre>
<div class="block">Allows subclasses to add their own granted authorities to the list to be returned
in the <tt>UserDetails</tt>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>username</code> - the username, for use by finder methods</dd>
<dd><code>authorities</code> - the current granted authorities, as populated from the
<code>authoritiesByUsername</code> mapping</dd>
</dl>
</li>
</ul>
<a id="getUsersByUsernameQuery()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getUsersByUsernameQuery</h4>
<pre class="methodSignature">public&nbsp;java.lang.String&nbsp;getUsersByUsernameQuery()</pre>
</li>
</ul>
<a id="initDao()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>initDao</h4>
<pre class="methodSignature">protected&nbsp;void&nbsp;initDao()
                throws org.springframework.context.ApplicationContextException</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>initDao</code>&nbsp;in class&nbsp;<code>org.springframework.dao.support.DaoSupport</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>org.springframework.context.ApplicationContextException</code></dd>
</dl>
</li>
</ul>
<a id="loadUserByUsername(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>loadUserByUsername</h4>
<pre class="methodSignature">public&nbsp;<a href="../UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;loadUserByUsername&#8203;(java.lang.String&nbsp;username)
                               throws <a href="../UsernameNotFoundException.html" title="class in org.springframework.security.core.userdetails">UsernameNotFoundException</a></pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../UserDetailsService.html#loadUserByUsername(java.lang.String)">UserDetailsService</a></code></span></div>
<div class="block">Locates the user based on the username. In the actual implementation, the search
may possibly be case sensitive, or case insensitive depending on how the
implementation instance is configured. In this case, the <code>UserDetails</code>
object that comes back may have a username that is of a different case than what
was actually requested..</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../UserDetailsService.html#loadUserByUsername(java.lang.String)">loadUserByUsername</a></code>&nbsp;in interface&nbsp;<code><a href="../UserDetailsService.html" title="interface in org.springframework.security.core.userdetails">UserDetailsService</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>username</code> - the username identifying the user whose data is required.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a fully populated user record (never <code>null</code>)</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../UsernameNotFoundException.html" title="class in org.springframework.security.core.userdetails">UsernameNotFoundException</a></code> - if the user could not be found or the user has no
GrantedAuthority</dd>
</dl>
</li>
</ul>
<a id="loadUsersByUsername(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>loadUsersByUsername</h4>
<pre class="methodSignature">protected&nbsp;java.util.List&lt;<a href="../UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&gt;&nbsp;loadUsersByUsername&#8203;(java.lang.String&nbsp;username)</pre>
<div class="block">Executes the SQL <tt>usersByUsernameQuery</tt> and returns a list of UserDetails
objects. There should normally only be one matching user.</div>
</li>
</ul>
<a id="loadUserAuthorities(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>loadUserAuthorities</h4>
<pre class="methodSignature">protected&nbsp;java.util.List&lt;<a href="../../GrantedAuthority.html" title="interface in org.springframework.security.core">GrantedAuthority</a>&gt;&nbsp;loadUserAuthorities&#8203;(java.lang.String&nbsp;username)</pre>
<div class="block">Loads authorities by executing the SQL from <tt>authoritiesByUsernameQuery</tt>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a list of GrantedAuthority objects for the user</dd>
</dl>
</li>
</ul>
<a id="loadGroupAuthorities(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>loadGroupAuthorities</h4>
<pre class="methodSignature">protected&nbsp;java.util.List&lt;<a href="../../GrantedAuthority.html" title="interface in org.springframework.security.core">GrantedAuthority</a>&gt;&nbsp;loadGroupAuthorities&#8203;(java.lang.String&nbsp;username)</pre>
<div class="block">Loads authorities by executing the SQL from
<tt>groupAuthoritiesByUsernameQuery</tt>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a list of GrantedAuthority objects for the user</dd>
</dl>
</li>
</ul>
<a id="createUserDetails(java.lang.String,org.springframework.security.core.userdetails.UserDetails,java.util.List)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>createUserDetails</h4>
<pre class="methodSignature">protected&nbsp;<a href="../UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;createUserDetails&#8203;(java.lang.String&nbsp;username,
                                        <a href="../UserDetails.html" title="interface in org.springframework.security.core.userdetails">UserDetails</a>&nbsp;userFromUserQuery,
                                        java.util.List&lt;<a href="../../GrantedAuthority.html" title="interface in org.springframework.security.core">GrantedAuthority</a>&gt;&nbsp;combinedAuthorities)</pre>
<div class="block">Can be overridden to customize the creation of the final UserDetailsObject which is
returned by the <tt>loadUserByUsername</tt> method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>username</code> - the name originally passed to loadUserByUsername</dd>
<dd><code>userFromUserQuery</code> - the object returned from the execution of the</dd>
<dd><code>combinedAuthorities</code> - the combined array of authorities from all the authority
loading queries.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the final UserDetails which should be used in the system.</dd>
</dl>
</li>
</ul>
<a id="setAuthoritiesByUsernameQuery(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setAuthoritiesByUsernameQuery</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setAuthoritiesByUsernameQuery&#8203;(java.lang.String&nbsp;queryString)</pre>
<div class="block">Allows the default query string used to retrieve authorities based on username to
be overridden, if default table or column names need to be changed. The default
query is <a href="JdbcDaoImpl.html#DEF_AUTHORITIES_BY_USERNAME_QUERY"><code>DEF_AUTHORITIES_BY_USERNAME_QUERY</code></a>; when modifying this query,
ensure that all returned columns are mapped back to the same column positions as in
the default query.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>queryString</code> - The SQL query string to set</dd>
</dl>
</li>
</ul>
<a id="getAuthoritiesByUsernameQuery()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getAuthoritiesByUsernameQuery</h4>
<pre class="methodSignature">protected&nbsp;java.lang.String&nbsp;getAuthoritiesByUsernameQuery()</pre>
</li>
</ul>
<a id="setGroupAuthoritiesByUsernameQuery(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setGroupAuthoritiesByUsernameQuery</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setGroupAuthoritiesByUsernameQuery&#8203;(java.lang.String&nbsp;queryString)</pre>
<div class="block">Allows the default query string used to retrieve group authorities based on
username to be overridden, if default table or column names need to be changed. The
default query is <a href="JdbcDaoImpl.html#DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY"><code>DEF_GROUP_AUTHORITIES_BY_USERNAME_QUERY</code></a>; when modifying
this query, ensure that all returned columns are mapped back to the same column
positions as in the default query.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>queryString</code> - The SQL query string to set</dd>
</dl>
</li>
</ul>
<a id="setRolePrefix(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setRolePrefix</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setRolePrefix&#8203;(java.lang.String&nbsp;rolePrefix)</pre>
<div class="block">Allows a default role prefix to be specified. If this is set to a non-empty value,
then it is automatically prepended to any roles read in from the db. This may for
example be used to add the <tt>ROLE_</tt> prefix expected to exist in role names
(by default) by some other Spring Security classes, in the case that the prefix is
not already present in the db.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>rolePrefix</code> - the new prefix</dd>
</dl>
</li>
</ul>
<a id="getRolePrefix()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getRolePrefix</h4>
<pre class="methodSignature">protected&nbsp;java.lang.String&nbsp;getRolePrefix()</pre>
</li>
</ul>
<a id="setUsernameBasedPrimaryKey(boolean)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setUsernameBasedPrimaryKey</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setUsernameBasedPrimaryKey&#8203;(boolean&nbsp;usernameBasedPrimaryKey)</pre>
<div class="block">If <code>true</code> (the default), indicates the
<a href="JdbcDaoImpl.html#getUsersByUsernameQuery()"><code>getUsersByUsernameQuery()</code></a> returns a username in response to a query. If
<code>false</code>, indicates that a primary key is used instead. If set to
<code>true</code>, the class will use the database-derived username in the returned
<code>UserDetails</code>. If <code>false</code>, the class will use the
<a href="JdbcDaoImpl.html#loadUserByUsername(java.lang.String)"><code>loadUserByUsername(String)</code></a> derived username in the returned
<code>UserDetails</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>usernameBasedPrimaryKey</code> - <code>true</code> if the mapping queries return the
username <code>String</code>, or <code>false</code> if the mapping returns a
database primary key.</dd>
</dl>
</li>
</ul>
<a id="isUsernameBasedPrimaryKey()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>isUsernameBasedPrimaryKey</h4>
<pre class="methodSignature">protected&nbsp;boolean&nbsp;isUsernameBasedPrimaryKey()</pre>
</li>
</ul>
<a id="setUsersByUsernameQuery(java.lang.String)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setUsersByUsernameQuery</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setUsersByUsernameQuery&#8203;(java.lang.String&nbsp;usersByUsernameQueryString)</pre>
<div class="block">Allows the default query string used to retrieve users based on username to be
overridden, if default table or column names need to be changed. The default query
is <a href="JdbcDaoImpl.html#DEF_USERS_BY_USERNAME_QUERY"><code>DEF_USERS_BY_USERNAME_QUERY</code></a>; when modifying this query, ensure that all
returned columns are mapped back to the same column positions as in the default
query. If the 'enabled' column does not exist in the source database, a permanent
true value for this column may be returned by using a query similar to
<pre> &quot;select username,password,'true' as enabled from users where username = ?&quot;
 </pre></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>usersByUsernameQueryString</code> - The query string to set</dd>
</dl>
</li>
</ul>
<a id="getEnableAuthorities()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnableAuthorities</h4>
<pre class="methodSignature">protected&nbsp;boolean&nbsp;getEnableAuthorities()</pre>
</li>
</ul>
<a id="setEnableAuthorities(boolean)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setEnableAuthorities</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setEnableAuthorities&#8203;(boolean&nbsp;enableAuthorities)</pre>
<div class="block">Enables loading of authorities (roles) from the authorities table. Defaults to true</div>
</li>
</ul>
<a id="getEnableGroups()">

</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnableGroups</h4>
<pre class="methodSignature">protected&nbsp;boolean&nbsp;getEnableGroups()</pre>
</li>
</ul>
<a id="setEnableGroups(boolean)">

</a>
<ul class="blockList">
<li class="blockList">
<h4>setEnableGroups</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setEnableGroups&#8203;(boolean&nbsp;enableGroups)</pre>
<div class="block">Enables support for group authorities. Defaults to false</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>enableGroups</code> - </dd>
</dl>
</li>
</ul>
<a id="setMessageSource(org.springframework.context.MessageSource)">

</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setMessageSource</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;setMessageSource&#8203;(org.springframework.context.MessageSource&nbsp;messageSource)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>setMessageSource</code>&nbsp;in interface&nbsp;<code>org.springframework.context.MessageSourceAware</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>

<footer role="contentinfo">
<nav role="navigation">

<div class="bottomNav"><a id="navbar.bottom">

</a>
<div class="skipNav"><a href="JdbcDaoImpl.html#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">

</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="JdbcDaoImpl.html#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="JdbcDaoImpl.html#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">

</a></div>

</nav>
</footer>
<script>if (window.parent == window) {(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga');ga('create', 'UA-2728886-23', 'auto', {'siteSpeedSampleRate': 100});ga('send', 'pageview');}</script><script defer src="https://static.cloudflareinsights.com/beacon.min.js/v652eace1692a40cfa3763df669d7439c1639079717194" integrity="sha512-Gi7xpJR8tSkrpF7aordPZQlW2DLtzUlZcumS8dMQjwDHEnw9I7ZLyiOj/6tZStRBGtGgN6ceN6cMH8z7etPGlw==" data-cf-beacon='{"rayId":"7040d83bedaf980c","token":"bffcb8a918ae4755926f76178bfbd26b","version":"2021.12.0","si":100}' crossorigin="anonymous"></script>
</body>
</html>
